/*
 * @Description: 原文与条目
 * @Author: ZzT
 * @Date: 2023-03-03 10:15:48
 * @LastEditTime: 2023-03-03 10:22:35
 */

import { useState } from 'react';
import HandoverTasks from '../../../dialogs/HandoverTasks';
import { IBaseProp } from '@/components/LevelTable';
import { EnumReceiveTypes, receiveTypeName } from '@/dictionary/transfer';

interface ITransferProps {
  info: IBaseProp;
  selectItems: number[];
  type?: EnumReceiveTypes.Excel | EnumReceiveTypes.ZIP;
}

const Handover = (props: ITransferProps) => {
  const { selectItems, info, type = EnumReceiveTypes.Excel } = props;

  const [visible, setVisible] = useState(false);
  const onClose = () => {
    setVisible(false);
  };
  return (
    <>
      <div
        onClick={() => {
          setVisible(true);
        }}
      >
        {receiveTypeName(type)}
      </div>
      <HandoverTasks
        visible={visible}
        info={info}
        type={type}
        selectItems={selectItems}
        onClose={onClose}
      />
    </>
  );
};
export default Handover;
